<!doctype html>
<html>
<head lang="en">
    <meta charset="UTF-8">
<title>登录</title>
<style>
#big{ width:523px; height:772px; margin: 70px 620px;}

</style>
</head>

<body background="img/11-1.jpg">
<form method="post">
<div id="big">
	    <div class="content">
        <div class="main">
      <table width="600"  align="center"cellspacing="25px;">

      <tr>
          <td width="100" align="right">用户名称:</td>
          <td width="309"><input type="text" name="user" placeholder="请输入用户名"/></td>
      </tr>
          <tr>
              <td align="right">密码:</td>
              <td><input type="password" name="password" placeholder="请输入密码"/></td>
          </tr>
          <br>
          <tr>
              <td align="right"><span>身份:</span></td>
              <td colspan="5">
                  <select style="" size="1">
                      <option value="普通用户" style="text-align: center;">普通用户</option>
                      <option value="管理员">会员</option>
                  </select></td>
          </tr>
          <td colspan="2" align="center">
         <div style="width:400px;float:left; margin-left:10px;">
             <input type="radio" name="auto_login" value="1"/> 自动登录

             <span style="color:#999;">如果没有账号请您：</span>
             <a href="zhuce.php">注册</a></div>
          </td>
      </tr>
      <tr>
          <td  width="100" colspan="2" align="left">
          <a href="#"><input type="submit"
                             value="登录" 
                             style="width:462px; height:61px; background:#4288FF; font-size:25px; color:#FFF;">
          </a>
          </td>
      </tr>
</table>
</div>
	</div></div>


</body>
</html>

<?php
header("content-type:text/html;charset=utf-8");

if($_SERVER['REQUEST_METHOD']=='POST')
{
    session_start();
    $user=$_POST['user'];
    $password=$_POST['password'];

    if($user==""){
        echo"<script>alert('请输入用户名！')</script>";
}elseif($password==""){
    echo"<script>alert('请输入密码！')</script>";
}elseif($password!=""&&$user!=""){
if($user!=$_SESSION['user']||$password!=$_SESSION['password']){
echo"<script>alert('用户名或密码错误！')</script>";
}elseif($user==$_SESSION['user']&&$password==$_SESSION['password']){
header('Location:../oppo.html');
}
}
}
?>